
package com.ruoyi.busi.guide.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.ruoyi.busi.guide.domain.Education;
import com.ruoyi.busi.guide.mapper.EducationMapper;
import com.ruoyi.busi.guide.service.IEducationService;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * 教育经历Service业务层处理
 */
@Service
public class EducationServiceImpl extends ServiceImpl<EducationMapper, Education> implements IEducationService {

    private final EducationMapper educationMapper;

    public EducationServiceImpl(EducationMapper educationMapper) {
        this.educationMapper = educationMapper;
    }

    @Override
    public List<Education> selectByMentorId(Long mentorId) {
        if (mentorId == null) {
            throw new IllegalArgumentException("导师ID不能为空");
        }
        return educationMapper.selectByMentorId(mentorId);
    }

    @Override
    public List<Education> selectBySchool(String school) {
        if (school == null || school.isEmpty()) {
            throw new IllegalArgumentException("学校名称不能为空");
        }
        return educationMapper.selectBySchool(school);
    }

    @Override
    public boolean deleteEducationByIds(List<Long> educationIds) {
        return this.removeByIds(educationIds);
    }
}
